import java.util.Objects;

class Student{
    private String id;

    public Student(String id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return Objects.equals(id, student.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    @Override
    public String toString() {
        return "Student{" +
                "id='" + id + '\'' +
                '}';
    }
}
public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("123");
        Student student2 = new Student("123");
        System.out.println(student1.hashCode());
        System.out.println(student2.hashCode());
    }
}
